package com.example.demo.thread.ch5;

/**
 * 对传输通道的抽象
 *
 * @author: htc
 * @date: Created in 16:00 2019/1/14.
 */
public interface Channel<P> {
    /**
     * 往传输通道中存入一个产品
     * @param product
     */
    void put(P product) throws InterruptedException;

    /**
     * 从传输通道中取出一个产品
     * @return
     * @throws InterruptedException
     */
    P take() throws InterruptedException;
}
